package cn.amebius.simpledocker.entity.dto;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * UserGroupInfoDto的Dto数据类
 * @author 阿伟
 * @date 2023/7/28 18:43
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserGroupInfoDto {

    private Integer groupId;

    private String name;

    private String description;

    private Date createTime;

    public static void check(UserGroupInfoDto ugid) {
        if (ugid == null || ugid.groupId.toString().isEmpty() || ugid.name.isEmpty() || ugid.description.isEmpty() || ugid.createTime.toString().isEmpty()) {
            throw new DataErrorException("数据异常:用户组信息丢失");
        }
    }

}
